'use strict';

module.exports = {
  up: async queryInterface => {
    /**
     * Add seed commands here.
     *
     * Example:
     * await queryInterface.bulkInsert('People', [{
     *   name: 'John Doe',
     *   isBetaMember: false
     * }], {});
    */
    await queryInterface.bulkInsert('menus', [
      {
        id: 1,
        parentId: 0,
        title: '首页',
        path: '/layout/home',
        name: 'Home',
        component: 'Home',
        isFrame: '1',
        menuType: 'C',
        visible: '1',
        orderNum: 1,
        status: '1',
        perms: '',
        keepAlive: 0,
        icon: 'nav-home',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 2,
        parentId: 0,
        title: '系统管理',
        path: '/system',
        name: 'System',
        component: 'Layout',
        isFrame: '1',
        menuType: 'M',
        visible: '1',
        orderNum: 20,
        status: '1',
        perms: '',
        keepAlive: 0,
        icon: 'nav-system',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 3,
        parentId: 2,
        title: '用户中心',
        path: 'user',
        name: 'User',
        component: 'User',
        isFrame: '1',
        menuType: 'C',
        visible: '1',
        orderNum: 1,
        status: '1',
        perms: '',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 4,
        parentId: 2,
        title: '角色管理',
        path: 'role',
        name: 'Role',
        component: 'Role',
        isFrame: '1',
        menuType: 'C',
        visible: '1',
        orderNum: 2,
        status: '1',
        perms: '',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 5,
        parentId: 2,
        title: '菜单管理',
        path: 'menu',
        name: 'Menu',
        component: 'Menu',
        isFrame: '1',
        menuType: 'C',
        visible: '1',
        orderNum: 3,
        status: '1',
        perms: '',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 6,
        parentId: 2,
        title: '部门管理',
        path: 'dept',
        name: 'Dept',
        component: 'Dept',
        isFrame: '1',
        menuType: 'C',
        visible: '1',
        orderNum: 4,
        status: '1',
        perms: '',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 7,
        parentId: 2,
        title: '字典管理',
        path: 'dict',
        name: 'Dict',
        component: 'Dict',
        isFrame: '1',
        menuType: 'C',
        visible: '1',
        orderNum: 6,
        status: '1',
        perms: '',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 8,
        parentId: 2,
        title: '数据字典',
        path: 'dictData/:id',
        name: 'DictData',
        component: 'DictData',
        isFrame: '1',
        menuType: 'C',
        visible: '0',
        orderNum: 7,
        status: '1',
        perms: '',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },

      // 用户按钮权限
      {
        id: 9,
        parentId: 3,
        title: '查询',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 1,
        status: '1',
        perms: 'system:user:list',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 10,
        parentId: 3,
        title: '新增',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 2,
        status: '1',
        perms: 'system:user:add',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 11,
        parentId: 3,
        title: '修改',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 3,
        status: '1',
        perms: 'system:user:update',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 12,
        parentId: 3,
        title: '删除',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 4,
        status: '1',
        perms: 'system:user:delete',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 13,
        parentId: 3,
        title: '重置密码',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 5,
        status: '1',
        perms: 'system:user:resetPwd',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 14,
        parentId: 3,
        title: '修改头像',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 6,
        status: '1',
        perms: 'system:user:updateUserImg',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 15,
        parentId: 3,
        title: '修改密码',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 7,
        status: '1',
        perms: 'system:user:updateUserPwd',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      // 角色按钮权限
      {
        id: 16,
        parentId: 4,
        title: '查询',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 1,
        status: '1',
        perms: 'system:role:list',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 17,
        parentId: 4,
        title: '新增',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 2,
        status: '1',
        perms: 'system:role:add',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 18,
        parentId: 4,
        title: '修改',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 3,
        status: '1',
        perms: 'system:role:update',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 19,
        parentId: 4,
        title: '删除',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 4,
        status: '1',
        perms: 'system:role:delete',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 20,
        parentId: 4,
        title: '修改角色状态',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 5,
        status: '1',
        perms: 'system:role:changeRoleStatus',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      // 菜单按钮权限
      {
        id: 21,
        parentId: 5,
        title: '查询',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 1,
        status: '1',
        perms: 'system:menu:list',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 22,
        parentId: 5,
        title: '新增',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 2,
        status: '1',
        perms: 'system:menu:add',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 23,
        parentId: 5,
        title: '修改',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 3,
        status: '1',
        perms: 'system:menu:update',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 24,
        parentId: 5,
        title: '删除',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 4,
        status: '1',
        perms: 'system:menu:delete',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      // 部门按钮权限
      {
        id: 25,
        parentId: 6,
        title: '查询',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 1,
        status: '1',
        perms: 'system:department:list',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 26,
        parentId: 6,
        title: '新增',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 2,
        status: '1',
        perms: 'system:department:add',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 27,
        parentId: 6,
        title: '修改',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 3,
        status: '1',
        perms: 'system:department:update',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 28,
        parentId: 6,
        title: '删除',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 4,
        status: '1',
        perms: 'system:department:delete',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      // 字典管理按钮权限
      {
        id: 29,
        parentId: 7,
        title: '查询',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 1,
        status: '1',
        perms: 'system:dictType:list',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 30,
        parentId: 7,
        title: '新增',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 2,
        status: '1',
        perms: 'system:dictType:add',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 31,
        parentId: 7,
        title: '修改',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 3,
        status: '1',
        perms: 'system:dictType:update',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 32,
        parentId: 7,
        title: '删除',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 4,
        status: '1',
        perms: 'system:dictType:delete',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      // 数据字典按钮权限
      {
        id: 33,
        parentId: 8,
        title: '查询',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 1,
        status: '1',
        perms: 'system:dictData:list',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 34,
        parentId: 8,
        title: '新增',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 2,
        status: '1',
        perms: 'system:dictData:add',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 35,
        parentId: 8,
        title: '修改',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 3,
        status: '1',
        perms: 'system:dictData:update',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 36,
        parentId: 8,
        title: '删除',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 4,
        status: '1',
        perms: 'system:dictData:delete',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },

      {
        id: 37,
        parentId: 2,
        title: '消息公告',
        path: 'notice',
        name: 'Notice',
        component: 'Notice',
        isFrame: '1',
        menuType: 'C',
        visible: '1',
        orderNum: 10,
        status: '1',
        perms: '',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 38,
        parentId: 2,
        title: '系统日志',
        path: 'logs',
        name: 'Logs',
        component: 'Logs',
        isFrame: '1',
        menuType: 'C',
        visible: '1',
        orderNum: 14,
        status: '1',
        perms: '',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },

      // 消息通告按钮权限
      {
        id: 39,
        parentId: 37,
        title: '查询',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 1,
        status: '1',
        perms: 'system:notice:list',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 40,
        parentId: 37,
        title: '新增',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 2,
        status: '1',
        perms: 'system:notice:add',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 41,
        parentId: 37,
        title: '修改',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 3,
        status: '1',
        perms: 'system:notice:update',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 42,
        parentId: 37,
        title: '删除',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 4,
        status: '1',
        perms: 'system:notice:delete',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      // 系统日志按钮权限
      {
        id: 43,
        parentId: 38,
        title: '查询',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 1,
        status: '1',
        perms: 'system:logs:list',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 44,
        parentId: 38,
        title: '新增',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 2,
        status: '1',
        perms: 'system:logs:add',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 45,
        parentId: 38,
        title: '修改',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 3,
        status: '1',
        perms: 'system:logs:update',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 46,
        parentId: 38,
        title: '删除',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 4,
        status: '1',
        perms: 'system:logs:delete',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
      {
        id: 47,
        parentId: 38,
        title: '清除所有日志',
        path: null,
        name: null,
        component: null,
        isFrame: '0',
        menuType: 'F',
        visible: '1',
        orderNum: 5,
        status: '1',
        perms: 'system:logs:deleteAllLogs',
        keepAlive: 0,
        icon: '',
        isDelete: '0',
        remark: null,
        createdAt: new Date(),
        createdBy: 'admin',
      },
    ], {});
  },

  down: async queryInterface => {
    /**
     * Add commands to revert seed here.
     *
     * Example:
     * await queryInterface.bulkDelete('People', null, {});
     */
    await queryInterface.bulkDelete('menus', null, {});
  },
};
